<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            width: 200px;
            height: 150px;
            border: 5px solid greenyellow;
            position: relative;
            margin: auto;
            margin-top: 70px;
        }
        .box {
            position: relative;
            top: 30px;
            left: 50px;
            width: 70px;
            height: 75px;
            background-color: pink;
    
        }
        .box2 {
            left: 40px;
            width: 70px;
            height: 75px;
            background-color: red;
        }
        .fa{
            width: 180px;
            height: 150px;
            background-color: rgb(222, 23, 106);
        }
        .son{
            width: 80px;
            height: 50px;
            background-color: pink;
            position: absolute;
            top: 100px;
            left: 100px;
        }
        .top{
            width: 1200px;
            height: 30px;
            background-color: rgb(126, 185, 217);
            position: fixed;
            top: 30px;
            font-weight: 700;
            text-align: center;
        }
        .bottom{
         width: 1200px;
         height: 30px;
         background-color:skyblue;
         position: fixed;
         bottom: 40px;
        }
        .left{
            width: 30px;
            height: 480px;
            background-color: aqua;
            position: fixed;
            left: 10px;
            top: 80px;
        }
        .right{
            width: 30px;
            height: 480px;
            background-color: aqua;
            position: fixed;
            right: 10px;
            top: 80px;
        }
        p{
         text-align: center;
        }
    </style>
</head>
<body>
    <div class="box1">
        <div class="box">相对定位</div>
    <div class="box2"></div>
    </div>
   <div class="box1">
    <div class="fa"></div>
    <div class="son">绝对定位</div>
    </div>
    <div class="top">固定定位</div>
    <div class="bottom">下</div>
    <div class="left">左</div>
    <div class="right">右</div>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
    <p>Beauty</p>
</body>
</html>